package cosplay.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import cosplay.Beans.Tags;

@Controller
public class TestController extends MultiActionController {
//	@Autowired
//	DataSource data;

	//@Override
	@RequestMapping(value="/test.htm",method=RequestMethod.GET)
	protected ModelAndView handleRequestInternal(HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		// TODO Auto-generated method stub
		String message="Please input the new tag info";
		Tags tag=new Tags();
		ModelMap model=new ModelMap();
		model.addAttribute("message",message);
		model.addAttribute("tag",tag);
		model.addAttribute("target", "edittag.htm");
		return new ModelAndView("addtag","model",model);
		//return new ModelAndView("register");
	}
}
